﻿namespace FiniteAutomaton
{
    using QuickGraph;
    using System;
    using System.Collections.Generic;
    using System.Linq;

    public class NondeterministicFiniteAutomaton : IVertexListGraph<State, LabeledEdge<State, char>>
    {
        protected Deque<State> states = new Deque<State>();
        protected List<LabeledEdge<State, char>> transitions = new List<LabeledEdge<State, char>>();

        public Deque<State> States
        {
            get { return this.states; }
        }

        public List<LabeledEdge<State, char>> Transitions
        {
            get { return this.transitions; }
        }

        public bool ContainsEdge(State source, State target)
        {
            throw new NotImplementedException();
        }

        public bool TryGetEdges(State source, State target, out IEnumerable<LabeledEdge<State, char>> edges)
        {
            throw new NotImplementedException();
        }

        public bool TryGetEdge(State source, State target, out LabeledEdge<State, char> edge)
        {
            throw new NotImplementedException();
        }

        public bool IsOutEdgesEmpty(State v)
        {
            throw new NotImplementedException();
        }

        public int OutDegree(State v)
        {
            throw new NotImplementedException();
        }

        public IEnumerable<LabeledEdge<State, char>> OutEdges(State v)
        {
            return this.transitions.Where(t => t.Source == v);
        }

        public bool TryGetOutEdges(State v, out IEnumerable<LabeledEdge<State, char>> edges)
        {
            throw new NotImplementedException();
        }

        public LabeledEdge<State, char> OutEdge(State v, int index)
        {
            throw new NotImplementedException();
        }

        public bool IsDirected
        {
            get { throw new NotImplementedException(); }
        }

        public bool AllowParallelEdges
        {
            get { throw new NotImplementedException(); }
        }

        public bool ContainsVertex(State vertex)
        {
            throw new NotImplementedException();
        }

        public bool IsVerticesEmpty
        {
            get { throw new NotImplementedException(); }
        }

        public int VertexCount
        {
            get { throw new NotImplementedException(); }
        }

        public IEnumerable<State> Vertices
        {
            get { return this.states.AsEnumerable(); }
        }
    };
}
